package com.example.demo.Entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import java.util.Date;


/**
 * @version: V0.3
 * @author: 郑皓杰 吴嘉鑫
 * @className: HumanResource
 * @packageName: com.example.demo.Entity
 * @description: 这是HR实体类
 * @data: 2021-07-14
 **/

@JsonIgnoreProperties({"hibernateLazyInitializer","handler"})//是因为查询到的对象是null值没有获取到，无法反序列化为json 返回到前台
@Entity
@Table(name="hr")
public class  HumanResource{
	
	/**
	 * HRID
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer hrid;
	
	/**
	 * HR用户名
	 */
	private String username;
	
	/**
	 * HR所属公司名字
	 */
	private String companyName;
	
	/**
	 * HR所属公司ID
	 */
	private Integer companyID;
	
	/**
	 * HR所属公司是否缺人
	 */
	private boolean isRecruiting;
	
	@CreationTimestamp
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date updated;//更新时间
	
	@CreationTimestamp
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date created;//构建时间

	public Integer getHrid() {
		return hrid;
	}

	public void setHrid(Integer hrid) {
		this.hrid = hrid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public Integer getCompanyID() {
		return companyID;
	}

	public void setCompanyID(Integer companyID) {
		this.companyID = companyID;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@Override
	public String toString() {
		return "HumanResource [hrid=" + hrid + ", username=" + username + ",  companyName="
				+ companyName + ", companyID=" + companyID + ", updated=" + updated + ", created=" + created + "]";
	}

	public boolean isRecruiting() {
		return isRecruiting;
	}

	public void setRecruiting(boolean isRecruiting) {
		this.isRecruiting = isRecruiting;
	}


	

}
